from django.contrib import admin
from article.models import *
from isa.models import CUser
# Register your models here.


class TagInline(admin.StackedInline):
    model = ATags
    extra = 1


class CommitsAdmin(admin.ModelAdmin):
    
    list_display = ["article",]

class ArticlesAdmin(admin.ModelAdmin):
    fieldsets = [
        (
            "Article",{
                'fields':['title','content',]
            }),
        (
            "Author",{
                'fields':['author'],
            }),
        (
            "File upload",{
                'fields' : ['attach_file']
            }),
        (
            'Links ',{
                'fields':['link'],
            }),

    ]

    inlines = [TagInline]

    list_display = ["title",]

admin.site.register(Articles,ArticlesAdmin)
admin.site.register(Commits,CommitsAdmin)